/**
 * Learn more about using TypeScript with React Navigation:
 * https://reactnavigation.org/docs/typescript/
 */

import type { AxiosRequestConfig, AxiosResponse } from "axios";
import { BottomTabScreenProps } from "@react-navigation/bottom-tabs";
import {
  CompositeScreenProps,
  NavigatorScreenParams,
} from "@react-navigation/native";
import { NativeStackScreenProps } from "@react-navigation/native-stack";

declare global {
  namespace ReactNavigation {
    interface RootParamList extends RootStackParamList {}
  }
}

export type RootStackParamList = {
  Home: NavigatorScreenParams<RootTabParamList> | undefined;
  Goods: undefined;
  Modal: undefined;
  NotFound: undefined;
  ProductList: {
    classifyId: Number;
  };
  ProductDetails: {
    goodsId: string;
    goodsColor: string;
  };
  Login: undefined;
  Mine: undefined;
  ShoppingCar: undefined;
};

export type RootStackScreenProps<Screen extends keyof RootStackParamList> =
  NativeStackScreenProps<RootStackParamList, Screen>;

export type RootTabParamList = {
  TabOne: undefined;
  TabTwo: undefined;
  Home: undefined;
  Goods: undefined;
  ProductDetails: undefined;
};

export type RootTabScreenProps<Screen extends keyof RootTabParamList> =
  CompositeScreenProps<
    BottomTabScreenProps<RootTabParamList, Screen>,
    NativeStackScreenProps<RootStackParamList>
  >;

export type getHomeConfiguration = {
  code: Number;
  data: [
    {
      isEdit: boolean;
      name: String;
      pageBgColor: String;
      region: String;
      remarks: String;
      title: String;
      value: Object;
    }
  ];
  extra: null;
  msg: String;
  success: boolean;
};

export type ListJson = {
  data: [
    {
      h5Url: string;
      classifyName: string;
      list: [ListJsonListItem];
      relationIds: string;
    }
  ];
  msg: string;
  status: number;
};

export type ListJsonListItem = {
  brand: String;
  brandCode: String;
  channelId: String;
  classifyId: number;
  classifyLevel: String;
  classifyName: String;
  createTime: number;
  goodsSortType: number;
  h5Link: String;
  h5Url: string;
  hasChild: false;
  id: number;
  isBigpic: String;
  isShow: String;
  list: [];
  miniprogramUrl: String;
  name: String;
  parentId: number;
  pcLink: String;
  pcUrl: String;
  picUrl: String;
  priority: String;
  relationIds: String;
  sortBy: number;
  topBannerUrl: String;
  unitedwebsiteClassifyCode: String;
};

export type ProductListItem = {
  bookingEndTime: null;
  bookingStartTime: null;
  brand: string;
  brandCode: string;
  brandName: string;
  categoryName: string;
  channelId: null;
  classifyDgbIds: null;
  classifyDgbNames: null;
  classifyIds: string;
  classifyNames: string;
  classifyPcIds: null;
  classifyPcNames: null;
  classifyUnitedwebsiteIds: string;
  clickRate: number;
  colorAlias: string;
  colorAliasEn: null;
  colorName: string;
  createTime: string;
  describeEn: null;
  description: string;
  discount: number;
  discountPrice: number;
  discountUpdateTime: string;
  estimateIntegral: null;
  foreverTime: null;
  goodsCode: string;
  goodsInfo: string;
  goodsInfoEn: null;
  goodsInfoPc: null;
  goodsInfoPcen: null;
  goodsName: string;
  goodsNameEn: string;
  goodsType: string;
  gsColorCode: string;
  gscMaincolPath: string;
  gscMaincolorId: null;
  gscolorCodes: string;
  id: number;
  imgUrls: null;
  introVideoUrl: string;
  keyWords: string;
  kocTaskAcceptanceCode: string;
  memberId: null;
  originalPrice: number;
};

export type goodsDetail = {
  projectCode: string;
  goodsName: string;
  color: goodsDetailColor[];
};

export type goodsDetailColor = {
  colorCode: string;
  color: string;
  colorAlias: string;
  originalPrice: number;
  price: number;
  discount: number;
  sizes: Array<sizes>;
};

export type sizes = {
  sku: string;
  size: string;
  sizeAlias: string;
  virtualCount: string;
  sellStock: number;
};

export type MineBanner = {
  code: Number;
  msg: String;
  data: MineBannerDataItem[];
  success: Boolean;
};

export type MineBannerDataItem = {
  brand: string;
  createTime: string;
  id: number;
  link: string;
  linkCode: string;
  linkType: string;
  orderBy: number;
  picUrl: string;
  type: string;
  updateTime: string;
};

export type userInfo = {
  _id: string;
  userName: string;
  phone: string;
  email: string;
  avatar: string;
  birth: string;
  gender: string;
  password: string;
  createdItem: number;
  __v: number;
};

export interface ShoppingCarList {
  code: Number;
  msg: String;
  data: ShoppingCarListDataItem[];
  success: Boolean;
}

export  interface ShoppingCarListDataItem {
  addPrice: number;
  colorName: string;
  crmId: string;
  goodsCode: string;
  goodsName: string;
  goodsSku: string;
  gsColorCode: string;
  gscPicmainId: string;
  gscPicmainPath: string;
  quantity: number;
  sizeName: string;
  _id: string;
}
